home *** CD-ROM | disk | FTP | other *** search
- Path: news.lpr.carel.fi!usenet
- From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
- Newsgroups: comp.lang.c
- Subject: Re: a link problem
- Date: Fri, 02 Feb 1996 14:12:40 +0200
- Organization: Carelcomp Forest
- Message-ID: <3111FFB8.2BBA@cmt.lpr.mail.carel.fi>
- References: <4ers17$4c3@srvr1.engin.umich.edu>
- NNTP-Posting-Host: renoir.cclahti.carel.fi
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (WinNT; I)
-
- Chih-Jen Lin wrote:
- >
- > Hi,
- >
- > It seems that the order of .o files in makefile affect
- > link result. For example, if function A in a.c call function
- > B in b.c, then I need to use
- > %cc ... a.o b.o
- > and can't use
- > %cc ... b.o a.o
- >
- > This looke very inconvinent. Is there any way to solve
- > this problem ? Thanks for your help.
- >
- > Chih-Jen Lin
-
- Not unless your linker reads all files in and only after that tries to resolve
- the external references. Check the command line options (man ld). You could, of
- course, create a library where you stored your .o files (except the main file)
- and link with that. (cc ... a.o -lxx...).
-
- Later,
- AriL
- --
- All my opinions are mine and mine alone.
-